<template>
  <div v-if="menu.name" style="width: 580px; padding: 15px">
    <div style="font-weight: bolder; font-size: 26px">
      {{ menu.label }}
    </div>
    <div>
      {{ menu.description }}
    </div>
    <div style="margin-top: 10px">
      <a-form-item label="参数">
        <a-textarea v-model:value="menuVal" placeholder="非必填" :auto-size="{ minRows: 8, maxRows: 8 }" />
      </a-form-item>
    </div>
    <div style="display: flex; justify-content: right">
      <div>
        <a-button type="primary" @click="handleOk">确定</a-button>
      </div>
    </div>
  </div>
  <div v-else style="width: 580px; padding: 15px"></div>
</template>
<script>
import { defineComponent, ref, watch, toRefs, reactive } from 'vue'

export default defineComponent({
  props: {
    isShowPrams: { type: Boolean, default: false },
    menu: {
      type: Object,
      default: () => {
        return {}
      },
    },
  },
  emits: ['layoutSelected'],
  setup(props, ctx) {
    const visible = ref(false)
    const { isShowPrams: isShowEdit } = toRefs(props)
    watch(isShowEdit, (newValue, oldValue) => {
      if (newValue) {
        visible.value = true
      }
    })

    /***表单*****************************/

    //==页脚按钮=================
    const handleOk = (e) => {
      ctx.emit('layoutSelected', '')
      cancal()
    }
    const cancal = () => {
      visible.value = false
    }

    const menuVal = ref('')

    return {
      visible,
      handleOk,
      cancal,
      menuVal,
    }
  },
})
</script>

<style scoped></style>
